class Segments3 extends egret.Sprite {
    private slider: SimpleSlider
    private segment: Segment
    public constructor() {
        super()
        this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
    }

    private onAddToStage(event: egret.Event) {
        this.segment = new Segment(100, 20)
        this.addChild(this.segment)
        this.segment.x = 100
        this.segment.y = 120

        this.slider = new SimpleSlider(-180, 180, 0)
        this.slider.x = 300
        this.slider.y = 20
        this.addChild(this.slider)
        this.slider.addEventListener(egret.Event.CHANGE, this.onChange, this)
    }

    private onChange() {
        this.segment.rotation = this.slider.value
    }
}